package vns.client.event;

import java.util.List;

import vns.shared.ObjectDTO;
import vns.shared.ObjectPropertyDTO;
import vns.shared.ObjectTypeDTO;

import com.google.gwt.event.shared.GwtEvent;

public class ObjectEditEvent extends GwtEvent<ObjectEditEventHandler> {

	public static Type<ObjectEditEventHandler> TYPE = new Type<ObjectEditEventHandler>();

	private ObjectDTO ObjectDTO;
	private ObjectTypeDTO ObjectTypeDTO;
	private List<ObjectPropertyDTO> listObjectPropertyDTO;
	private String operation;

	public ObjectEditEvent(
			ObjectDTO ObjectDTO, 
			ObjectTypeDTO ObjectTypeDTO,
			List<ObjectPropertyDTO> listObjectPropertyDTO,
			String operation
			) {
		this.ObjectDTO = ObjectDTO;
		this.ObjectTypeDTO = ObjectTypeDTO;
		this.listObjectPropertyDTO = listObjectPropertyDTO;
		this.operation = operation;
	}

	@Override
	public Type<ObjectEditEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ObjectEditEventHandler handler) {
		handler.onEditObject(this);
	}

	public void setObjectDTO(ObjectDTO ObjectId) {
		this.ObjectDTO = ObjectId;
	}

	public ObjectDTO getObjectDTO() {
		return ObjectDTO;
	}

	public void setObjectTypeDTO(ObjectTypeDTO objectTypeDTO) {
		ObjectTypeDTO = objectTypeDTO;
	}

	public ObjectTypeDTO getObjectTypeDTO() {
		return ObjectTypeDTO;
	}

	public void setListObjectPropertyDTO(List<ObjectPropertyDTO> listObjectPropertyDTO) {
		this.listObjectPropertyDTO = listObjectPropertyDTO;
	}

	public List<ObjectPropertyDTO> getListObjectPropertyDTO() {
		return listObjectPropertyDTO;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	public String getOperation() {
		return operation;
	}
}
